import java.util.Arrays;
import java.util.Scanner;

public class Test_7_17_1 {
    //添加逗号
    //9803645356--->9,803,645,356
    //980364535---->980,364,535
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        char[] ch = s.toCharArray();
        StringBuilder stringBuilder = new StringBuilder();

        int n = ch.length;
        for (int i = n-1; i >=0 ; i--) {
            stringBuilder.append(ch[i]);
            if ((n-i) % 3 == 0){
                stringBuilder.append(",");
            }
        }
        stringBuilder.reverse();
//        for (int i = 0; i < n; i++) {
//            stringBuilder.append(ch[i]);
//            if ((n-i-1) % 3 == 0 && i!=n-1){
//                stringBuilder.append(',');
//            }
//        }
        System.out.println(stringBuilder.toString());
    }
}
